<<<<<<< HEAD
function []=barkspectrum(arg1)

[audioIn,fs] = audioread(arg1);

audioIn=pre_emphasis(audioIn)
	
segmentDuration = 1;
frameDuration = 0.025;
hopDuration = 0.010;
FFTLength = 512;
numBands = 50;
segmentSamples = round(segmentDuration*fs)
frameSamples = round(frameDuration*fs)
hopSamples = round(hopDuration*fs)
overlapSamples = frameSamples - hopSamples
	
aFE = audioFeatureExtractor(SampleRate=fs, ...
                            SpectralDescriptorInput="barkSpectrum", ... 
		                    FFTLength=FFTLength,... 
		                    Window=hann(frameSamples,"periodic"),... 
		                    OverlapLength=overlapSamples,...
                            barkSpectrum=true,...
                            spectralCentroid=false);
setExtractorParameters(aFE, "barkSpectrum",...
	NumBands=numBands,...
	WindowNormalization=false,...
	FilterBankNormalization='bandwidth',...
    FilterBankDesignDomain='warped'	);

f=figure
plotFeatures(aFE,audioIn,parent=f);

features = extract(aFE,audioIn);

[path, filename, extension] = fileparts(arg1);
fn = strcat(filename,".jpg");
saveas(f,fn);
fn = strcat(filename,".txt");

format short
writematrix(features,fn,'delimiter','tab');

end
=======
function []=barkspectrum(arg1)

[audioIn,fs] = audioread(arg1);

audioIn=pre_emphasis(audioIn)
	
segmentDuration = 1;
frameDuration = 0.025;
hopDuration = 0.010;
FFTLength = 512;
numBands = 50;
segmentSamples = round(segmentDuration*fs)
frameSamples = round(frameDuration*fs)
hopSamples = round(hopDuration*fs)
overlapSamples = frameSamples - hopSamples
	
aFE = audioFeatureExtractor(SampleRate=fs, ...
                            SpectralDescriptorInput="barkSpectrum", ... 
		                    FFTLength=FFTLength,... 
		                    Window=hann(frameSamples,"periodic"),... 
		                    OverlapLength=overlapSamples,...
                            barkSpectrum=true,...
                            spectralCentroid=false);
setExtractorParameters(aFE, "barkSpectrum",...
	NumBands=numBands,...
	WindowNormalization=false,...
	FilterBankNormalization='bandwidth',...
    FilterBankDesignDomain='warped'	);

f=figure
plotFeatures(aFE,audioIn,parent=f);

features = extract(aFE,audioIn);

[path, filename, extension] = fileparts(arg1);
fn = strcat(filename,".jpg");
saveas(f,fn);
fn = strcat(filename,".txt");

format short
writematrix(features,fn,'delimiter','tab');

end
>>>>>>> dd81f2d (bug fix and add  fold tests)
